package com.example.treehole.ui.page.treehole

import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import com.example.treehole.LocalPostListViewModel
import com.example.treehole.ui.component.PostCard
import com.example.treehole.ui.model.PostInfo

@Composable
fun SearchPage(){
    val postListViewModel = LocalPostListViewModel.current
    val postList by postListViewModel.searchPostList.collectAsState()
    val listState = postListViewModel.searchListState

    LazyColumn(state = listState) {
        items(postList){item: PostInfo ->
            PostCard(
                post = item
            )
        }
    }
}